package com.example.yangxu0703.thundermapclient.interaction;

import android.app.ProgressDialog;
import android.content.Context;

public class HoldByDialog {
    private ProgressDialog dialog;

    public HoldByDialog(Context context) {
        dialog=new ProgressDialog(context);
    }

    public  void showDialog(String msg) {
        dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        dialog.setIndeterminate(false);
        dialog.setCanceledOnTouchOutside(false);
        dialog.setCancelable(true);
        dialog.setMessage(msg);
        dialog.show();
    }

    public  void dismiss() {
        if (dialog!=null){
            dialog.dismiss();
        }
    }

    public void changeMessage(String msg){
        if (dialog!=null){
            dialog.setMessage(msg);
        }
    }
}
